package ru.ssau.university.web.beans;

import java.util.List;

import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

import ru.ssau.university.ejb.api.UniversityServiceLocal;
import ru.ssau.university.persistence.entity.Faculty;

@ManagedBean(name="welcomeBean")
@RequestScoped
public class WelcomeBean {
	
	@EJB
	private UniversityServiceLocal universityService;
	private List<Faculty> faculties;
	
	public WelcomeBean() {
		
	}
	
	public String initAll() {
		faculties = universityService.getFaculties();
		return null;
	}

	public List<Faculty> getFaculties() {
		return faculties;
	}

	public void setFaculties(List<Faculty> faculties) {
		this.faculties = faculties;
	}
}
